package com.aaa.web.controller.financeController;

import com.aaa.entity.BackExpenseorder;
import com.aaa.entity.repair.BackEntrepotrecordCll;
import com.aaa.web.service.ifinance.IFinanceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassName FinanceInfoController
 * @Description 财务统计
 * @Author caolinlin
 * @Date 2018/12/27 14:57
 **/
@Controller
@RequestMapping("/finance")
public class FinanceInfoController {

    @Autowired
    private IFinanceInfoService iFinanceInfoService;

    @RequestMapping("/getFinancePage")
    public String toFinancePage(){
        return "views/webhtml/finance/financeInfo";
    }

    /**
     * 月收入支出
     * @param years
     * @return
     */
    @RequestMapping("/getFinanceInAndOut")
    @ResponseBody
    public List<BackExpenseorder> getFinanceInAndOut(String years){

        List<BackExpenseorder> list=iFinanceInfoService.getFinanceInAndOut(years);

        return list;
    }

    /**
     * 年收入类型
     * @param years
     * @return
     */
    @RequestMapping("/getFinanceInFrom")
    @ResponseBody
    public List<BackExpenseorder> getFinanceInFrom(String years){

        List<BackExpenseorder> list=iFinanceInfoService.getFinanceInFrom(years);

        return list;
    }

    /**
     * 月支出类型
     * @param years
     * @return
     */
    @RequestMapping("/getFinanceOutFrom")
    @ResponseBody
    public List<BackEntrepotrecordCll> getFinanceOutFrom(String years){
        List<BackEntrepotrecordCll> list=iFinanceInfoService.getFinanceOutFrom(years);

        return list;
    }
}
